package com.demo.designmode.factory.method;

/**
 * @Author: jxm
 * @Description: 披萨总店
 * @Date: 2021/7/6 16:05
 * @Version: 1.0
 */
public abstract class PizzaStore {

    public Pizza orderPizza(String type) {
        Pizza pizza;
        pizza = createPizza(type);

        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();

        return pizza;
    }

    /*
     * 创建pizza的方法交给子类去实现
     */
    abstract Pizza createPizza(String type);
}
